package com.chinasofti.manager.domain.demo;

public class MyTest {
    int arr[]={1,3,5,67,8};
    public void Maxarr(){
        int max = arr[0];
        for (int i = 0;i<arr.length;i++){
            if(max<arr[i]){
                max=arr[i];
            }
        }
        System.out.println("最大值是"+max);
    }
    public void Minarr(){
        int min = arr[0];
        for (int i = 0;i<arr.length;i++){
            if(min>arr[i]){
                min=arr[i];
            }
        }
        System.out.println("最小值是"+min);
    }
    public void Avgarr(){
        int sum=0;
        for (int a:arr){
            sum+=a;
        }
        System.out.println("平均值是"+sum/arr.length);
    }
}
